package com.example.fresh_fruit.service;

import com.example.fresh_fruit.entity.Commodity;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author :飞天の鱼
 * @date : 2022/8/15 15:01
 */
@Repository
public interface CommodityService {

    /**
     * @param id
     * 检查商品的状态
     * @return
     */
    int checkCommodity(Integer id);

    boolean insertCom(Commodity commodity);//增加商品,并且上架,在之前查询名称是否重复

    Commodity findName(String name);

    boolean upCom(Commodity commodity);

    Commodity isdelete(String name);

   List<Commodity> findByName(String name);//模糊查询

   Commodity findById(Integer id);

    boolean updata(Commodity commodity);//修改商品的信息

    boolean updataNumber(Commodity commodity);
}
